home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 12 - 1996 / 12.05 May 96 / 12.05 Symantec Top 10 < prev    next >
Encoding:
Text File  |  1996-04-18  |  1.5 KB  |  55 lines  |  [TEXT/R*ch]

  1. Q:    How do I use AppendDITL() in a Think Pascal project?
  2.  
  3. A:    This call was new to System 7 and never really made it into the old
  4. toolbox library.  It is, however, declared in the CommToolBox.lib.  Here is the
  5. way to get it working.
  6.     Add CommToolBox.lib to your project.
  7.     Create a unit (or modify an existing one) that declares AppendDITL as
  8. external.  Something like:
  9.  
  10.             unit myDeclarations;
  11.             interface
  12.  
  13.             procedure AppendDITL(
  14.                 theDialog:DialogPtr; 
  15.                 theHandle:Handle; 
  16.                 method:integer);
  17.  
  18.             implementation
  19.  
  20.             procedure AppendDITL(
  21.                 theDialog:DialogPtr;
  22.                 theHandle:Handle;
  23.                 method:integer);
  24.                             external;
  25.  
  26.             end.
  27.  
  28.     Notice that I changed the method parameter to an integer type, so that I
  29. would not have to declare DITLMethod also.  (You may want to declare that, and
  30. the method constants also for elegance.)
  31.  
  32. Q:    Do I still have to use the pragmas for instantiation of static templates?
  33.  
  34. A:    No. The compiler now accepts template-explicit instantiation as outlined
  35. in the ANSI C++ draft standard (dated 9/26/95) Section 14.4 pp. 14-15.  The
  36. following pre-8.1.0 statements:
  37.  
  38.                 template <class T> void f(T t);
  39.                 template <class T> class X { };
  40.  
  41.                 #pragma template_access public
  42.                 #pragma template f(int)
  43.                 #pragma template X<int>
  44.  
  45.     are equivalent to:
  46.  
  47.                 template <class T> void f(T t);
  48.                 template <class T> class X { };
  49.  
  50.                 template void f(int);
  51.                 template class X<int>;
  52.  
  53.     Note: The old method of using #pragma template directives continues to be
  54. supported.
  55.